<%@ page language="java" contentType="text/html; charset=utf-8"
 pageEncoding="utf-8"%>
<%@page import="com.AAL.Model.PurchaseContract"%>
<%@page import="java.util.List"%>
<%@page import="com.AAL.Model.Account"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<sj:head jqueryui="true" jquerytheme="cupertino" />
 <%
	Account myAccount = null;
	int nhanvien=0;
	if(session.getAttribute("myAccount")!=null){
		myAccount =(Account) session.getAttribute("myAccount");
		
	}
	
%>

<h3 style="background-color: #8AC0E9; font-size:17px; width: 95%; padding: 10px ;color: white;">Thêm mới hợp đồng</h3>
<br />

<p style="clear: both;"></p>
	<div style="margin: 10px;"><s:form id="form" method="post"
	action="#" theme="simple" cssClass="yform"> 
	<fieldset style="width: 95%;"><legend
		style="margin-left: 10px; font-weight: bold;">Thông tin chi tiết của hợp đồng</legend>
	<div class="type-text">
	<ul class="form">
		<li class="left">Mã hợp đồng:</li>
		<li class="right"><s:property value="contract.purchaseContractID" />
		</li>
		<li class="clr"></li>
		<li class="left">Nhà cung cấp :</li>
		<li class="right"><s:property value="contract.providerName" /></li>
		<li class="clr"></li>
		<li class="left">Địa chỉ  :</li>
		<li class="right"><s:property value="contract.addressOfProvider" /></li>
		<li class="clr"></li>
		<li class="left">Nhân viên mua hàng  :</li>
		<li class="right"><p class="smallInput wide" style="width: 250px; margin: 0px; "><%=myAccount.getAccountInformation().getFullName() %></p> </li>
		<li class="clr"></li>
		<li class="left">Nhân viên xác nhận  :</li>
		<li class="right"><p class="smallInput wide" style="width: 250px; margin: 0px; "><%=myAccount.getAccountInformation().getFullName() %></p></li>
		<li class="clr"></li>
		<li class="left">Ngày lập hợp đồng  :</li>
		<li class="right"><s:date name="contract.contractDate" format="dd/MM/yyyy" /></li>
		<li class="clr"></li>
		<li class="left">Ngày hết hợp đồng  :</li>
		<li class="right"><s:date format="dd/MM/yyyy" name="contract.deliveryDate" /></li>
		<li class="clr"></li>
		<li class="left">Trạng thái  :</li>
		<li class="right">
		<s:property value="contract.statusOfContract.statusName" />	
		</li>
		<li class="clr"></li>
		<li>
			
			<div style="margin: 10px;">
			<fieldset style="width: 95%;"><legend
				style="margin-left: 10px; font-weight: bold;">Danh sách các hàng hóa trong hợp đồng</legend>
			<div class="type-text">

			<table width="99%" cellpadding="0" cellspacing="0" id="box-table-a"
				summary="Employee Pay Sheet">
			<thead>
			<tr>
				<th width="20%" scope="col">STT</th>
				<th width="20%" scope="col">Mã sản phẩm</th>
				<th width="20%" scope="col">Tên sản phẩm</th>			
				<th width="20%" scope="col">Dòng xe</th>
				<th width="20%" scope="col">Số lượng</th>
			</tr>
			</thead>
			<tbody>
				<% int i=1; %>
				<s:iterator value="lstContractDetail">
				
				<tr>
					<td width="20%" scope="col"><%=i++ %></td>
					<td width="20%" scope="col"><s:property value="wheelDetail.wheelDetailID" /></td>
					<td width="20%" scope="col"><s:property value="wheelDetail.typesOfWheel.productName" /></td>
					<td width="20%" scope="col"><s:property value="wheelDetail.typesOfWheel.typeOfAuto.typeOfAutoName" /></td>
					<td width="20%" scope="col"><s:property value="amount" /></td>
				</tr>
				</s:iterator>
				<tr></tr>
		   
		   </tbody>
		</table>
	</div>

	</fieldset>
</div>
		
		</li>
		<li class="clr"></li>
		<li class="clr"></li>
		<li class="clr"></li>
		<li class="clr"></li>
		<li class="left">&nbsp;</li>
		<li class="right">
		  	</li>
		<li class="clr"></li>
	</ul>
		
	</div>
	</fieldset>
</s:form></div>